#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 25;

int n, m;
int a[N << 1];
ll b[N];
ll dp[N][N];
pii pre[N][N];

void solve() {
  cin >> n;
  rep(i, 1, n * 2) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  b[0] = 1;
  rep(i, 1, n) b[i] = b[i - 1] * 10;
  dp[0][0] = 0;
  rep(i, 1, n) {
    dp[0][i] = dp[0][i - 1] + a[i] * b[n - i];
    dp[i][0] = dp[i - 1][0] + a[i] * b[n - i];
    pre[0][i] = pii(0, i - 1);
    pre[i][0] = pii(i - 1, 0);
  }
  rep(i, 1, n) rep(j, 1, n) {
    ll x = dp[i - 1][j] + a[i + j] * b[n - i];
    ll y = dp[i][j - 1] + a[i + j] * b[n - j];
    if (x >= y) {
      dp[i][j] = x, pre[i][j] = pii(i - 1, j);
    } else {
      dp[i][j] = y, pre[i][j] = pii(i, j - 1);
    }
  }
  string ans;
  int x = n, y = n;
  while (x || y) {
    pii p = pre[x][y];
    if (x == p.first)
      ans.push_back('M');
    else
      ans.push_back('H');
    x = p.first, y = p.second;
  }
  reverse(ans.begin(), ans.end());
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}